package com.fr.report.web.ui.impl.page;

import com.fr.base.Inter;
import com.fr.base.core.util.TemplateUtils;
import com.fr.report.web.ui.Icon;
import com.fr.report.web.ui.IconManager;
import com.fr.report.web.ui.WebContentUtils;
import com.fr.web.Repository;

public final class Previous extends TabRelatedToolBarButton
{
  public Previous()
  {
    super(Inter.getLocText("ReportServerP-Previous"), IconManager.PREVIOUS.getName());
  }

  protected String clickAction(Repository paramRepository)
  {
    return WebContentUtils.getPreviousPageAction(paramRepository);
  }

  protected String onContentPanelAfterLoad(Repository paramRepository)
  {
    return TemplateUtils.render("if(${CP}.rtype==='view'){this[${CP}.curLGP.currentPageIndex==1?'disable':'enable']();}else{this[${CP}.currentPageIndex==1?'disable':'enable']();}", "CP", WebContentUtils.getContentPanel(paramRepository));
  }

  protected String onTabChange(Repository paramRepository)
  {
    return TemplateUtils.render("this[${CP}.lgps[arguments[1]].currentPageIndex==1?'disable':'enable']()", "CP", WebContentUtils.getContentPanel(paramRepository));
  }
}